import java.net.*;
import java.util.Scanner;
import java.io.*;

public class Client {
	public static void main(String arg[]){

		try{
			Socket s=new Socket("localhost",18000);

			PrintWriter out = new PrintWriter(s.getOutputStream(), true);
			BufferedReader buffr = new BufferedReader(new InputStreamReader(s.getInputStream()));
			Scanner sc = new Scanner(System.in);
			String message;
			while(sc.hasNext()){
				message=sc.nextLine();
				out.print(message + "\n");
				out.flush();
				System.out.println(buffr.readLine());
			}
			s.close();

		}
		catch(Exception e){e.printStackTrace();}
	}
}
